import request from '@/utils/request';

export async function queryMainProductList(page_num, page_size) {
  return request(`/api/gold/main_product_list?page_num=${page_num}&page_size=${page_size}`, {
    page_num,
    page_size,
  });
}

export async function addMainProductList(product_name, product_type_id) {
  return request(`/api/gold/main_product_create`, {
    method: 'POST',
    body: {
      product_name,
      product_type_id,
    },
  });
}

export async function updateMainProductList(product_name, product_type_id, id) {
  return request(`/api/gold/main_product_update`, {
    method: 'POST',
    body: {
      product_name,
      product_type_id,
      id,
    },
  });
}

export async function deleteMainProductList(id) {
  return request(`/api/gold/main_product_delete`, {
    method: 'POST',
    body: {
      id,
    },
  });
}
